-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature/kill button - adding the kill button on top of NodeTree #500
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @mikibonacci. Just two small comments.
I think for this button, it should be only enabled only when the workchain is in "running" state, so the state of the button should be update when the new process is selected from the workchain selector list. |
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #500 +/- ##
==========================================
+ Coverage 78.60% 80.99% +2.39%
==========================================
Files 44 45 +1
Lines 3160 3805 +645
==========================================
+ Hits 2484 3082 +598
- Misses 676 723 +47
Flags with carried forward coverage won't be shown. Click here to find out more.
☔ View full report in Codecov by Sentry. |
Cool, I might steal this, wanted to have this feature for a while :-) Hower, my plan was to implement the button next somewhere next to the NodeTree widget of a running process. It seems a bit out of place in the Workchain selector, I would worry about accidentally clicking it. WDYT? |
@danielhollas thanks a lot for chime in. It is a great point. My plan was to bring in this concept to the QeApp and we think about the layout afterward. |
Just to clarify, I did not mean to implement it directly in the Node tree widget, just as a simple standalone button somewhere next to it. You also highlight an important point, having just an icon without any explanation is very cryptic, whereas an big red scary "Kill workflow" button would be more obvious. |
Dear @danielhollas thank you for your feedback! indeed, I think that the button should be somewhere near the workchain tree. Maybe for this release we can still have the button near the other two (new and refresh), and then in the future put it in a more reasonable place? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One more minor thing to change, others are all good to me.
src/aiidalab_qe/common/process.py
Outdated
ipw.dlink( | ||
(self, "value"), | ||
(self.kill_work_chains_button, "disabled"), | ||
lambda workchain: orm.load_node(workchain).is_terminated | ||
if isinstance(workchain, int) | ||
else True, | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of using dlink
, I think it is more proper to set the disable of the button in the callback function _observe_value
. Because:
- the
dlink
is a bit complex with the transform from uuid to the running status, which will be clear if it is a regular code block in the function. - In the
refresh_work_chain
method, the disable of the button is check and set, this has the same logic asdlink
here and the refresh should trigger the callback (it is already the case I assume, if not we need to fix it).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
moving the disabling of the kill button into the _observe_value method.
However, in the init method I had to add the disabling, otherwise if
the browser page is refreshed (or loaded for the first time), it will not be
automatically disabled. I still do not understand why, but it works and the logic is not too involved.
@unkcpz please let me know if there is a smarter way to do it!
I see, sorry for misunderstanding it. I guess you mean add it here, aiidalab-qe/src/aiidalab_qe/app/result/__init__.py Lines 25 to 30 in 967c3f8
I can see the advantage of putting the button here, but I also thing having the kill button with "new", "refresh" is compatible with its usage. Let's discuss this in the meeting and see what others think. |
Hi @mikibonacci, as we discussed during the meeting, we agree on that this button better to be placed above the node tree. Can you move it to there, thanks. |
Kill button now is in the step 4, just above the NodeTree. Also, if no workchain is shown, the button is not shown either. And is enabled only if the workchain is running/waiting/created. |
(still no effect on click button)
it uses the control module from aiida.engine.processes
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
However, in the init method I had to add the disabling, otherwise if the browser page is refreshed (or loaded for the first time), it will not be automatically disabled. I still do not understand why
for more information, see https://pre-commit.ci
if no workchain is selected, the button is not shown.
for more information, see https://pre-commit.ci
e1b42a3
to
df1d435
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We had an offline pair coding and tidying up a bit on the implementation. All good from me. Thanks a lot! @mikibonacci
Nice, can you post a screenshot of the final product? When thinking about
this, I couldn't figure out where is the best place to put it.
Dne čt 19. 10. 2023 17:29 uživatel Jusong Yu ***@***.***>
napsal:
… Merged #500 <#500> into main.
—
Reply to this email directly, view it on GitHub
<#500 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACIY64OED5IBHMYLAIWUHLLYAFIN3AVCNFSM6AAAAAA5YR6TOOVHI2DSMVQWIX3LMV45UABCJFZXG5LFIV3GK3TUJZXXI2LGNFRWC5DJN5XDWMJQG4YTINJQGE4TOOI>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Fixes #161
adding the kill button to support live-killing of a workchain, just selecting it from the list and clicking on the button.